module.exports = {
  projects: [
    {
      displayName: 'unit',
      testMatch: ['<rootDir>/tests/unit/**/*.test.js'],
      setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
      maxWorkers: 1,
      detectOpenHandles: false
    },
    {
      displayName: 'integration',
      testMatch: ['<rootDir>/tests/integration/**/*.test.js'],
      setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
      maxWorkers: 1,
      detectOpenHandles: false
    },
    {
      displayName: 'mcp',
      testMatch: ['<rootDir>/tests/mcp/**/*.test.js'],
      testEnvironment: 'node',
      setupFilesAfterEnv: ['<rootDir>/tests/mcp/setup.js'],
      maxWorkers: 1,
      detectOpenHandles: false
    },
    {
      displayName: 'root-tests',
      testMatch: ['<rootDir>/test/**/*.test.js'],
      testEnvironment: 'node',
      setupFilesAfterEnv: [],
      maxWorkers: 1,
      detectOpenHandles: false
    }
  ],
  collectCoverageFrom: [
    'lib/**/*.js',
    'index.js',
    '!**/node_modules/**'
  ],
  coverageDirectory: 'coverage',
  coverageReporters: ['text', 'lcov', 'html'],
  coverageThreshold: {
    global: {
      branches: 70,
      functions: 70,
      lines: 70,
      statements: 70
    }
  },
  verbose: false,
  clearMocks: true,
  resetMocks: true,
  restoreMocks: true,
  bail: false,
  errorOnDeprecated: false,
  reporters: ['default']
};